package com.schooldate.model.service.impl;

import com.schooldate.base.BaseSupportImpl;
import com.schooldate.model.entity.HandMessage;
import com.schooldate.model.service.HandMessageService;
import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by etund on 2015/3/18 0018.
 */
@Service
@Transactional
@SuppressWarnings("all")
public class HandMessageServiceImpl extends BaseSupportImpl<HandMessage> implements HandMessageService {

    @Override
    public List<HandMessage> getTheRectent() {
        return this.getSession().createCriteria(HandMessage.class)
                .add(Restrictions.eq("isBroken",false))
                .setMaxResults(10)
                .list();
    }
}
